<<<<SDF FLAGS>>>>

//Town 2 - Upper Inn

(2,0) - 1 = pissed off the male traveler (dialogue node 11)
(2,1) - 1 = pissed off the female traveler (dnode 16)
(2,2) - 1 = set the time forward (init_state)
      - 2 = left the room (state 15)
(2,3) - 1 = saw the room with the passed out traveler (state 20)
(2,4) - 1 = paid for a room (t0dlg, dnode 16)
(2,5) - 1 = realized you won't be able to sleep in S room (state 27)

//Town 0 - Stratton
(0,0) - 1 = entry dialog (start_state)
(0,1) - 1 = settled bar tab (dnode 11)
(0,2) - 1 = know inn's services (dnode 13)
(0,3) - 1 = heard Ryan's efreet story (dnode 34)
(0,4) - 1 = know what Alexa offers (dnode 41)
(0,5) - 1 = know Alexa lives in Stratton (dnode 42)
(0,6) - 1 = Alexa's amber speech (dnode 44)
(0,7) - 1 = already listened to part of soldier's story (dnode 55)
(0,8) - 1 = got mayor's ursagi story (dnode 71)
(0,9) - 1 = know mayor was an adventurer (dnode 74)
(0,10)- 1 = know what Helen sells (dnode 82)
(0,11)- 1 = "I don't want to talk about it" (dnode 81,87)
(0,12)- 1 = Johann's hunting story (dnode 91)
(0,13)- 1 = know what Joahnn sells (dnode 92)
(0,14)- 1 = know Rebecca makes weapons (dnode 101)
(0,15)- 1 = know Rebecca fancies Anthony (dnode 104)
      - 2 = told Anthony (dnode 24)
      - 3 = told Rebecca you told Anthony (dnode 105/6)
      - 4 = told Rebecca Anthony fancies her (dnode 107)
      - 5 = told Rebecca the truth (dnode 108)
(0,16)- 1 = know what Nathan sells (dnode 111)
(0,17)- 1 = Nathan mentioned cache of jewels in Stratton (dnode 113)
      - 2 = Nathan gave quest (dnode 114/5)
      - 3 = told Nathan about jewels (dnode 116)
      - 4 = find the chamber sealed off (t8, state 70)
      - 5 = saw Nathan isn't back yet (state 30)
(0,18)- 1 = Leave the inn for real (state 21)
(0,19)- 1 = Fountain dialog (state 25)
(0,20)- 1 = bazaar dialog (state 30)
(0,21)- 1 = well dialog (state 35)
(0,22)- 1 = Nathan's house dialog (state 40, door trigger)
      - 2 = managed to open the door to his room (state 41, door trigger)
      - 3 = opened the box (state 42, specobj trigger)
(0,23)- 1 = found the mayor (state 45, door trigger)
(0,24)- 1 = Helen's shop dialog (state 50)
(0,25)- 1 = book on the bookshelf in Alexa's house (state 55)
(0,26)- 1 = trap in Alexa's house (trap trigger)
(0,27)- 1 = trap in Alexa's room (trap trigger)
(0,28)- 1 = supply closet (state 11)
(0,29)- 1 = kitchen (state 12)

//Town 1 - Cathedral, floor 1
(1,0) - 1 = intro dialog (START_STATE)
(1,1) - 1 = fountain dialog (state 15)
(1,2) - 1 = custodians' door dialog (state 20)
(1,3) - 1 = approach the doors (state 25)
      - 2 = open the doors (state 26, door trigger)
      - 3 = step inside (state 27)
      - 4 = read the sign for the sanctuary (signage trigger & state 30)
      - 5 = the sanctuary (state 30)
(1,4) - 1 = first spiel from Richardson (dnode 11/12)
      - 2 = second spiel - "what now?" (dnode 27)
      - 3 = Final spiel (dnode 28)
(1,5) - 1 = where are the catacombs (dnode 18)
(1,6) - 1 = how can you help me/us (dnode 17/19)
(1,7) - 1 = where is Brother Silas? (dnode 16, or dnode 110 of t3dlg)
(1,8) - 1 = tell me/us about your faith (dnode 23/24)
      - 2 = got one of the other nodes (dnode 25/26)
      - 3 = got the other other one (dnode 26/25)
      - 4 = dnode 23/24 disappears
(1,9) - 1 = dnode 25
(1,10)- 1 = dnode 26
(1,11)- 1 = read the sign for the cloak room (signage trigger)
      - 2 = cloak room dialog (state 50)
(1,12)- 1 = small shrine dialog (state 55)
(1,13)- 1 = statues dialog (state 60)
(1,14)- 1 = read the sign for the public shrine (signage trigger)
      - 2 = talked to Alyse about public-ness (dnode 44)
(1,15)- 1 = Alyse - are you worried about the ghosts? (dnode 42)
(1,16)- 1 = Ethan's job, and Felix and Paula (dnode 51)
(1,17)- 1 = Alyse whining about Ethan (dnode 43)
      - 2 = telling Ethan (dnode 54)
      - 3 = telling Alyse (dnode 47)
      - 4 = telling Ethan you spoiled his fun (dnode 56)
(1,18)- 1 = read kitchen sign (signage)
      - 2 = kitchen dialog (state 40)
(1,19)- 1 = 
(1,20)- 1 = Alyse & saving people (dnode 48)
(1,21)- 1 = Ethan can't teach spells (dnode 55)
(1,22)- 1 = Ethan's not so much a priest (dnode 52)
(1,23)- 1 = don't you have other people to clean? (dnode 57)
(1,24)- 1 = Norbert snapping at you (dnode 62 and 61)
(1,25)- 1 = no, I can't heal you, just an apprentice (dnode 63/64)
(1,26)- 1 = first dialog after the catacombs (INIT_STATE)
(1,27)- 1 = Paula's job (dnode 71)
      - 2 = Paula's current project (dnode 72)
(1,28)- 1 = Paula just teaches alchemy (dnode 73/4)
(1,29)- 1 = these herbs aren't ripe yet (state 20)
(11,0)- 1 = intro dialog node for Alyse, post-ghost (dnode 49)
(11,1)- 1 = intro dialog node for Ethan, post-ghost (dnode 58)
(11,2)- 1 = entering the sanctuary, post ghost (state 30)
(11,3)- 1 = Felix - are you okay? (dnode 81)
(11,4)- 1 = Felix - big ward spiel (dnode 82)
(11,5)- 1 = Felix - any advice? (dnode 83/84)
(11,6)- 1 = triggered Grimsley - ambush him (state 55 or door-state 80)
      - 2 = triggered Grimsley - wait it out (same)
(11,7)- 1 = Grimsley - who are you (dnode 92)
      - 2 = Grimsley - politics of the war (dnode 97)
(11,8)- 1 = Grimsley - why aren't you attacking (dnode 93, 94)
      - 2 = what are you doing here (dnode 94)
(11,9)- 1 = can we do anything to help you? (dnode 95/96)
      - 2 = gave him the crystal (dnode 98)
(11,10)-1 = looked at architect's statue (state 62)
      - 2 = told the architect (t8, dnode 31)
(11,11)-1 = talked to Ethan at all (dnode 50/58)
(11,12)-1 = why couldn't you get it yourself? (dnode 99)
(11,13)-1 = I/we lost the crystal (dnode 100/101)
(11,14)-1 = killed Grimsley
(11,15)-1 = final reward from Grimsley (dnode 102/3)
(11,16)-1 = FINAL CUTSCENE (state 100)

//Town 3 - 2nd floor Cathedral
(3,0) - 1 = intro dialog (only after ghosts released, INIT_STATE)
(3,1) - 1 = entered balcony (state 20)
(3,2) - 1 = read meditation cell sign (signage trigger)
      - 2 = walked into meditation cell (state 25)
(3,3) - 1 = walked into Silas' cell (state 30)
(3,4) - 1 = Silas who are you (dnode 111)
(3,5) - 1 = what'd they do to you? (dnode 112)
(3,6) - 1 = walking into Roberts' cell (state 35)
      - 2 = walked in after the ghosts left
(3,7) - 1 = freaked out Roberts (dnode 121)
(3,8) - 1 = told Roberts he's a coward (dnode 125)
      - 2 = reassured Roberts (dnode 126)
(3,9) - 1 = made Silas pass out (dnode 116)
(3,10)- 1 = descended to main floor, used for fleeing fights

//Town 4 - 3rd floor Cathedral
(4,0) - 1 = intro dialog (only after ghosts released, INIT_STATE)
(4,1) - 1 = started guard rescue quest (t1, state 70, door trigger)
      - 2 = saw body, entered office (state 30)
      - 3 = looked at body (state 31)
      - 4 = took body (state 31)
      - 5 = took the body outside, completed the quest (t1, state 90)
(4,2) - 1 = killed guard standing over body (START_STATE)
(4,3) - 1 = ambushed by archer (state 20)
      - 2 = the archer reappears! (implemented in START, t3-5)
      - 3 = killed archer (ghostarcher)
(4,4) - 1 = opened door to classroom B (state 40, door trigger)
      - 2 = walked into the room, trigger fight, mage dies (state 41)
(4,5) - 1 = read sign for classroom B (signage trigger)
(4,6) - 1 = read sign for Archives (signage trigger)
      - 2 = entered archives (state 50)
(4,7) - 1 = read sign for Classroom A (signage trigger)
      - 2 = opened door (state 60, door trigger)
      - 3 = entered classroom A (state 61)
(4,8) - 1 = priest stopped chanting (countdown trigger)
      - 2 = priest died (countdown trigger)
(4,9) - 1 = saw burnt burial ledger (state 52)
(4,10)- 1 = found empty scroll tube (state 53)
(4,11)- 1 = opened desk (state 54)
      - 2 = read bribe paper (state 54)
(4,12)- 1 = killed the priest's guard (START_STATE)
(4,13)- x = ambush archer's health (across INIT and EXITs)
(4,14)- 1 = tablets (state 62)
     

//Town 5 - 4th floor Cathedral
(5,0) - 1 = intro dialog (INIT_STATE)
(5,1) - 1 = killed east archer (ghostarcher trigger, DEATH_STATE)
(5,2) - 1 = killed west archer (ghostarcher trigger, DEATH_STATE)
(5,3) - 1 = triggered east ambush (state 21)
(5,4) - 1 = triggered west ambush (state 20)
(5,5) - 1 = dormitory sign (signage trigger)
      - 2 = entered west dormitory (state 30)
      - 3 = entered east dormitory (state 31)
      - 4 = entered both (state 30/31)
(5,6) - 1 = triggered door-freezing cutscene, fight (state 40, icydoor)
          = door sets itself to frozen = 1 unless captain is dead
      - 2 = fight respawned on another floor (START_STATE, t3-5)
      - 3 = dialog - entire fight complete (START_STATE, t3-5)
(5,7) - 1 = disrupted the mage in a fight once (ghostmage, DEATH_STATE)
(5,8) - 1 = killed SW archer, cr 9 (ghostarcher, DEAD_STATE)
(5,9) - 1 = killed SE archer, cr 7 (ghostarcher, DEAD_STATE)
(5,10)- 1 = killed W guard, cr 17 (basicnpc, DEAD_STATE)
(5,11)- 1 = killed E guard, cr 16 (basicnpc, DEAD_STATE)
(5,12)- 1 = killed elite soldier, cr 15 (basicnpc, DEAD_STATE)
(5,13)- 1 = captain spawned (state 40, START_STATE t3-5)
      - 2 = captain dead (captain DEAD_STATE, icydoor)
(5,14)- 1 = if captain dies when you see the door... (captain DEAD)
      - 2 = got first dialog for opening icydoor (icydoor BLOCK_MOVE)
            can only happen after captain is dead... mention that!
(5,15)- 1 = got cutscene after changing machine (INIT -> state 80)
      - 2 = left the room (state 81)

//Town 6 - 5th floor Cathedral
(6,0) - 1 = intro dialog, west spire (INIT_STATE)
(6,1) - 1 = intro dialog, east spire (INIT_STATE)
(6,2) - 1 = intro dialog, south spire (INIT_STATE)
      - 2 = dialog, post ghost
(6,3) - ...reset to zero at the end of each INIT_STATE
      - 1 = entering west spire
      - 2 = entering east spire
      - 3 = entering south spire
(6,4) - 1 = mage dies, kills statue if alive (ghostmage trigger, DEATH)
(6,5) - 1 = elite soldier dies (vengenpc trigger, DEATH)
(6,6) - 1 = statue dies (basicnpc trigger, DEATH)
(6,7) - x = health of mage
(6,8) - x = health of statue
(6,9) - x = health of elite soldier
(6,10)- 1 = got dialog for approaching the machine

//Town 7 - 6th floor Cathedral
(7,0) - 1 = intro dialog, west spire (state 20)
(7,1) - 1 = intro dialog, east spire (state 21)
(7,2) - ...reset to zero at the end of each INIT_STATE
      - 1 = entering west spire
      - 2 = entering east spire
(7,3) - 1 = triggered west spire box-fight (state 30)
      - 2 = killed soldier (state 32, basicnpc DEATH trigger)
(7,4) - 1 = triggered east spire box-fight (state 40)
      - 2 = killed soldier (state 42, basicnpc DEATH trigger)
(7,5) - 1 = got box dialog, west (state 31)
      - 2 = took crystal
(7,6) - 1 = got box dialog, east (state 41)
      - 2 = took crystal
(7,7) - x = health of west soldier (set at EXIT_STATE, retrieved at INIT)
(7,8) - x = health of east soldier (set at EXIT_STATE, retrieved at INIT)

//Town 8 - Catacombs
(8,0) - 1 = entrance dialog (START_STATE)
(8,1) - 1 = what's wrong? (dnode 11)
(8,2) - 1 = Felix's plot spiel (dnode 12/13)
(8,3) - 1 = what are the wards? (dnode 14)
(8,4) - 1 = what's your job? (dnode 15)
(8,5) - 1 = crossed rune into catacombs proper (state 20)
      - 2 = up the hall (state 21) - start insanity timer
      - 3 = crossed the runes before the big door (state 22)
(8,6) - 1 = runes guarding ghosts got erased (state 22)
(8,7) - 1 = opened door to the tomb (state 30, door trigger)
(8,8) - 1 = unmarked graves (state 31)
(8,9) - 1 = first search of machine (state 35, specobj)
      - 2 = switched crystals, released ghosts (state 36)
      - 3 = crossed runes on the way out of tomb (state 22)
      - 4 = triggered cutscene/fight (state 37)
      - 5 = triggered the ber-cutscene (state 38)
(8,10)- 1 = saw that Felix is gone (state 40)
(8,11)- 1 = crying ghost room (state 50)
(8,12)- 1 = who are you? (dnode 32)
(8,13)- 1 = read Mother Reese's tomb (state 100, specobj)
      - 2 = told her her name (dnode 62)
(8,14)- 1 = who were you? (dnode 60)
(8,15)- 1 = chamber w/ insubstantial ghost (state 51)
(8,16)- 1 = the runes outside patriarch chamber (state 70)
      - 2 = enter the chamber (state 71)
      - 3 = got sarcophagus dialog (state 72, specobj trigger)
      - 4 = trigger the fight (state 72, specobj trigger)
      - 5 = killed all the ghosts (START_STATE)
(8,17)- 1 = understood the runes

//Outdoors - Relonar
(30,0)- 1 = Anthony gave you directions (t0dlg, dnode 23)
      - 2 = came to fork in the road (state 15)
(30,1)- 1 = spires over the treetops (state 20)
      - 2 = full view of the cathedral (state 21)
(30,2)- 1 = approaching graveyard (state 25)
      - 2 = entered graveyard (state 26)
(30,3)- 1 = cleared the guards (state 30)
(30,4)- 1 = ran from the guards (state 30)

//Over-arching flags
(50,0)- 1 = RELEASED GHOSTS
(50,1)- 1 = SUPPRESSED GHOSTS
      - 2 = FREED GHOSTS
(50,2)- 1 = struck by ghost archer (ghostarcher)
(50,3)- x = number of mages killed

//Health flags for ghosts in big fight
(60,0)- x = captain's health
(60,1)- x = mage's health
(60,2)- x = elite soldier's health
(60,3)- x = west guard
(60,4)- x = east guard
(60,5)- x = NW archer
(60,6)- x = SW archer
(60,7)- x = SE archer
(60,8)- x = NE archer

<<<<<QUESTS>>>>>

0 - Settle Bar Tab
1 - Travel to Cathedral
2 - Huge Cache of Jewels
3 - Speak to Felix in Catacombs
4 - Swap Crystal
5 - Save Jack
6 - Speak with Felix Again 
7 - Repair Machinery
8 - Retrieve Crystal
9 - Free the Ghosts